#define _CRT_SECURE_NO_WARNINGS 1
//字符串左旋3.0
#include <stdio.h>
#include <string.h>
void Turn_left(char* p, int start, int end)
{
	int left = start;
	int right = end;
	while (left <= right)
	{
		char tmp = *(p + left);
		*(p + left) = *(p + right);
		*(p + right) = tmp;
		left++;
		right--;
	}
}

int main()
{
	char arr[10000] = "abcdefg";
	//gets(arr);
	int k = 0;
	scanf("%d", &k);
	int len = strlen(arr);
	k %= len;
	Turn_left(arr, 0, k-1);//反转前k个字符
	Turn_left(arr, k, len-1);//反转剩下的字符
	Turn_left(arr, 0, len-1);//反转所有字符
	puts(arr);
	return 0;
}